<template>
	<view>
		<view class="uni-padding-wrap uni-common-mt">
			<view>
				<scroll-view class="scroll-view_H" scroll-x="true">
					<view v-for="item in lists" :key="item.id" class="scroll-view-item_H">
						<image class="commodyPic" :src="item.src" mode="aspectFill"></image>
						<view style="padding: 0rpx 10rpx;">
							<view class="commodyName">{{item.name}}</view>
							<view class="commodyPrice">
								<text>￥{{item.price}}</text>
								<image class="add" src="../../static/index/plus.png" mode=""></image>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		name:'listCommodities',
		props:['lists'],
		data() {
			return {

			}
		},
		methods: {

		}
	}
</script>

<style lang="less">
	.scroll-view_H {
		white-space: nowrap;
		width: 100%;
		margin-top: 10rpx;
		padding-bottom: 30rpx;
	}

	.scroll-view-item_H {
		display: inline-block;
		background: #FFFFFF;
		border-radius: 8rpx;
		border: 1px solid #f2f2f2;
		width: 240rpx;
		height: 316rpx;
		margin: 0 14rpx;
		.commodyPic{
			display: block;
			width: 245rpx;
			height: 225rpx;			
		}
		.commodyName{
			font-size: 24rpx;
			font-weight: 600;
			overflow:hidden; //超出的文本隐藏
			text-overflow:ellipsis; //溢出用省略号显示
			white-space:nowrap; //溢出不换行
		}
		
		.commodyPrice{
			line-height: 50rpx;
			text{
				color: #FF7815;
				font-size: 32rpx;
				font-weight: 600;
			}
		}
	}
	
	.add{
		float: right;
		width: 36rpx;
		height: 36rpx;
	}
</style>